from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from flask_learn.ORM创建 import models


# 数据库连接
engine = create_engine("mysql+pymysql://root:qaz3357375@127.0.0.1:3306/test?charset=utf8", max_overflow=5)
Session = sessionmaker(bind=engine)
session = Session()

obj1 = models.Users(name='alex', extra='sb')
obj2 = models.Users(name='alex', extra='db')

session.add(obj1)
session.add(obj2)

# 提交
session.commit()


# https://www.cnblogs.com/wupeiqi/articles/5713330.html
